/**
 * 
 */
package ru.olympus.antonyhands.ao.server.item;

import java.util.ArrayList;
import java.util.List;

import ru.olympus.antonyhands.ao.shared.util.StringPair;

/**
 * @author AntonyHands
 * @since 14.02.2012
 */
public class ItemExchange extends ItemExchangeBase
{

    public static final String TAG_NAME = "item-exchange";

    private static final String ATTRIBUTE_COMMENT = "comment";

    /**
     * Комментарий (предположительно - где можно обменять)
     */
    private String _comment;

    @Override
    public String getTagName()
    {
        return TAG_NAME;
    }

    @Override
    public List<StringPair> getAttributes()
    {
        List<StringPair> list = new ArrayList<StringPair>();
        list.add(new StringPair(ATTRIBUTE_COMMENT, _comment));
        return list;
    }

    @Override
    public void setAttributes(List<StringPair> attributes)
    {
        for (StringPair pair : attributes)
            if (pair.getKey().equals(ATTRIBUTE_COMMENT))
                _comment = pair.getValue();
    }

}
